1. Field of the Invention
The present invention relates to an imaging apparatus such as a digital camera or a video camera. In particular, the present invention relates to a focus detection technique that acquires a contrast value of a captured image and detects a focal position based on the contrast value while driving a lens.
2. Description of the Related Art
A contrast method (also referred to as a hill-climbing method or a television autofocus (TV-AF) method) is applied to an AF operation. The contrast method acquires a contrast of a captured image at each step of driving a focusing lens that is included in an imaging lens, or an image sensor, in a direction of the optical axis. The contrast is acquired as an evaluation value, and a lens position that corresponds to the highest evaluation value is defined as an in-focus position. Japanese Patent No. 02821214 discusses an AF operation using the contrast method.
When the AF operation is performed using contrast information about an entire image plane, the AF operation tends to be affected by a perspective competition caused by a plurality of objects whose distances to an imaging apparatus are different. Consequently, the contrast method is generally performed by automatically or manually selecting a portion of the image plane.
In a digital single-lens reflex camera, the image sensor is shielded from light by a mirror or a shutter except during exposure. Therefore, the image sensor is not used when the camera performs the AF operation or an automatic exposure (AE) operation. Instead, other sensors appropriate for each usage are installed in the camera, and an optical path of the light entering from the imaging lens is divided to be received by an AF sensor or an AE sensor.
In recent years, there is a demand for a live view function in the digital single-lens reflex camera. The live view function displays an image formed on the image sensor, on a display element such as a back side liquid crystal display (LCD) panel, so that a user can confirm a composition or a focusing state. When the user uses the live view function, the mirror is flipped up, the shutter is opened, and the image sensor becomes exposed. In such a state, the light does not reach the AF sensor or the AE sensor, so that the sensors cannot perform the AF operation or the AE operation.
Therefore, it is necessary to perform a contrast AF function or an imaging area AE function using the image sensor in a case where the user performs the AF operation or the AE operation while using the live view function.
A single lens reflex camera acquires a contrast evaluation value while driving the lens when performing the contrast AF operation. However, both the contrast evaluation value and information about the lens position at which the contrast evaluation value is acquired are necessary to obtain an in-focus position.
Further, a single lens reflex camera that can perform an AF operation includes a focus lens driving motor in an interchangeable lens portion. The focus lens is driven while a lens driving amount is communicated from a camera portion to the interchangeable lens portion.
In the single lens reflex camera system, a pulse encoder in the interchangeable lens portion acquires lens position information. The camera portion acquires the lens position information by communicating with the interchangeable lens.
Japanese Patent Application Laid-Open No. 2002-131621 discusses a conventional technique in which accumulation timing of a phase-difference AF sensor is synchronized with the lens position information.
However, when the contrast method is applied to a single lens reflex camera in which a lens apparatus is detachably attached to an imaging apparatus, it is difficult to relate a contrast (sharpness) acquired at certain timing to a lens position of the focus lens at that timing.